package com.ruoyi.system.service.impl;

import java.util.List;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.system.domain.AppDitch;
import com.ruoyi.system.mapper.AppDitchMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.system.mapper.AppDitchUnderingMapper;
import com.ruoyi.system.domain.AppDitchUndering;
import com.ruoyi.system.service.IAppDitchUnderingService;

/**
 * 渠道下属用户Service业务层处理
 *
 * @author ruoyi
 * @date 2023-03-06
 */
@Service
public class AppDitchUnderingServiceImpl extends ServiceImpl<AppDitchUnderingMapper, AppDitchUndering> implements IAppDitchUnderingService {
    @Autowired
    private AppDitchUnderingMapper appDitchUnderingMapper;

    /**
     * 查询渠道下属用户
     *
     * @param id 渠道下属用户主键
     * @return 渠道下属用户
     */
    @Override
    public AppDitchUndering selectAppDitchUnderingById(Long id) {
        return appDitchUnderingMapper.selectAppDitchUnderingById(id);
    }

    /**
     * 查询渠道下属用户列表
     *
     * @param appDitchUndering 渠道下属用户
     * @return 渠道下属用户
     */
    @Override
    public List<AppDitchUndering> selectAppDitchUnderingList(AppDitchUndering appDitchUndering) {
        return appDitchUnderingMapper.selectAppDitchUnderingList(appDitchUndering);
    }

    /**
     * 新增渠道下属用户
     *
     * @param appDitchUndering 渠道下属用户
     * @return 结果
     */
    @Override
    public int insertAppDitchUndering(AppDitchUndering appDitchUndering) {
        appDitchUndering.setCreateTime(DateUtils.getNowDate());
        return appDitchUnderingMapper.insertAppDitchUndering(appDitchUndering);
    }

    /**
     * 修改渠道下属用户
     *
     * @param appDitchUndering 渠道下属用户
     * @return 结果
     */
    @Override
    public int updateAppDitchUndering(AppDitchUndering appDitchUndering) {
        return appDitchUnderingMapper.updateAppDitchUndering(appDitchUndering);
    }

    /**
     * 批量删除渠道下属用户
     *
     * @param ids 需要删除的渠道下属用户主键
     * @return 结果
     */
    @Override
    public int deleteAppDitchUnderingByIds(Long[] ids) {
        return appDitchUnderingMapper.deleteAppDitchUnderingByIds(ids);
    }

    /**
     * 删除渠道下属用户信息
     *
     * @param id 渠道下属用户主键
     * @return 结果
     */
    @Override
    public int deleteAppDitchUnderingById(Long id) {
        return appDitchUnderingMapper.deleteAppDitchUnderingById(id);
    }
}
